﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BLL.ResourceManage
{
   public  class commontree
   {
       private readonly OracleDAL.ResourceManage.ResourceBase dal = new OracleDAL.ResourceManage.ResourceBase();
       public DataTable getDs(string tablename, string id, string name,string remark)
       {
           string strSql = "select " + id + " as id," + name + " as name from "+ tablename +"";
           if (remark != "")
           {
               strSql = strSql + " where " + id + " like '" + remark +"__'";
           }
           else
           { 
           }
           DataTable dt = new  DataTable();
           dt = dal.GetSelectControlValue(strSql).Tables[0];

           return dt;
       }

       //获得翻译字段翻译表
       public DataTable getTran(string tablename, string filed)
       {
           DataTable dt = new DataTable();
           string strSql = "select transtable ,transcol,transedcol,remark from  cfg_resource_fields";
           strSql += " where enfield='" + filed + "' and tablename='" + tablename + "'";
           dt = dal.GetSelectControlValue(strSql).Tables[0];
           return dt;
       }
   
   }

}
